/// 一些常用的类和方法

YAHOO.namespace("solor.comic");


///全局对象

YAHOO.solor.comic.Global = {
    page : 1,
    total : 20,
    screenWidth : 200,
    currentShowPage: 0,
    imgWidth : "1000",
    imgHeight: "600",
    bgWidth : "1000",
    bgHeight : "600",
    shortKey: 
    {
      "single" : 
        {
             38 : "up",
             40 : "down",
             37 : "left", 
             39 : "right",
             33 : "pgup",
             34 : "pgdown"
        },
        "ctrl" : {
        }
   },
   xSteps : 10,
   ySteps : 10,
   keyEvents : []

}

// 报警的弹出窗口
YAHOO.solor.comic.showAlert = function (title, content)
{
    var cancel = function(){this.cancel()};
    YAHOO.solor.comic.Global.currentAlert = new YAHOO.widget.Dialog("comic_alert",  
                {   
                    width : "300px", 
                    fixedcenter : true, 
                    visible : false,  
                    constraintoviewport : true, 
                    buttons : [ 
                        { text:"恩， 我知道了", handler:cancel} 
                    ] 
                } 
                ); 
    YAHOO.solor.comic.Global.currentAlert.setHeader(title);
    YAHOO.solor.comic.Global.currentAlert.setBody(content);
    YAHOO.solor.comic.Global.currentAlert.render(document.body);
    YAHOO.solor.comic.Global.currentAlert.show();
}

// 建立全屏幕遮罩
// need prebuild <div id="comic_background" style="visibility:hidden"/>
YAHOO.solor.comic.buildBackground = function()
{
    YAHOO.solor.comic.Global.backgroundOverlay = new YAHOO.widget.Overlay("comic_background",
                            {fixedcenter : true,
                             visible:false,
                             width:'100%',
                             height:'100%'});
    YAHOO.solor.comic.Global.backgroundOverlay.render();
    YAHOO.solor.comic.Global.backgroundOverlay.show();
}
